<?php
/**
 * Created by PhpStorm.
 * User: 刘抱
 * Date: 2018/10/23
 * Time: 14:58
 */

namespace Home\Controller;


class LogController
{
    function __construct()
    {
        $where['data'] = json_encode($_REQUEST, true);
        $where['action'] = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
        $where['userId'] = isset($_SESSION['dms_uid']) ? $_SESSION['dms_uid'] : '0';
        $where['createdTime'] = date('Y-m-d H:i:s');
        $where['ip'] = $_SERVER["REMOTE_ADDR"];
        $where['message'] = strstr(__INFO__, '/', true);//获取Controller名
        if (!empty($where['data']) && IS_POST == true) {
            M("db_log")->add($where);
        }
    }

    public function get_method()
    {
        print_r(get_class_methods(new ContractController()));
    }


}